<template>
  <div>
    <h1>x坐标：{{ obj.x }}</h1>
    <h1>y坐标：{{ obj.y }}</h1>
    <h1>{{ count }}</h1>
    <button @click="changeCount">点击＋1</button>
  </div>
</template>

<script setup>
import { reactive, ref } from 'vue';
// 业务1：鼠标移动值
let obj = reactive({
  x: 0,
  y: 0,
});
document.addEventListener('mousemove', (e) => {
  obj.x = e.offsetX;
  obj.y = e.offsetY;
});

// 业务2：改变数值
let count = ref(0);
let changeCount = () => {
  count.value++;
};
</script>
